package com.example.myroomdemo.beans;

import androidx.room.Entity;
import androidx.room.PrimaryKey;
import androidx.room.TypeConverters;

import com.example.myroomdemo.BeansConverter.AreaConverter;
import com.example.myroomdemo.BeansConverter.BooksConverter;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by LFC
 * on 2020/10/29.
 */
@Entity
@TypeConverters({AreaConverter.class, BooksConverter.class})
public class Users {

    @PrimaryKey(autoGenerate = true)
    private Long roomID;
    private String strName = "";
    private int age = 1;
    private int sex = 1;
    private String strFrom = "";
    private String strNote = "";


    /**
     * 新增一个字段
     */
    private String strHobby = "";

    /**
     * 新增两个字段
     */
    private String strWeight = "";
    private int Height;

    /**
     * 新增实体类
     */
    private Address adsInfo;
    /**
     * 新增列表
     */
    private List<Books> listBooks;

    public Users() {
    }

    public Address getAdsInfo() {
        return adsInfo;
    }

    public void setAdsInfo(Address adsInfo) {
        this.adsInfo = adsInfo;
    }

    public List<Books> getListBooks() {
        if (listBooks == null) {
            return new ArrayList<>();
        }
        return listBooks;
    }

    public void setListBooks(List<Books> listBooks) {
        this.listBooks = listBooks;
    }

    public String getStrWeight() {
        return strWeight == null ? "" : strWeight;
    }

    public void setStrWeight(String strWeight) {
        this.strWeight = strWeight;
    }

    public int getHeight() {
        return Height;
    }

    public void setHeight(int height) {
        Height = height;
    }

    public String getStrHobby() {
        return strHobby == null ? "" : strHobby;
    }

    public void setStrHobby(String strHobby) {
        this.strHobby = strHobby;
    }

    public Long getRoomID() {
        return roomID;
    }

    public void setRoomID(Long roomID) {
        this.roomID = roomID;
    }

    public String getStrName() {
        return strName == null ? "" : strName;
    }

    public void setStrName(String strName) {
        this.strName = strName;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public int getSex() {
        return sex;
    }

    public void setSex(int sex) {
        this.sex = sex;
    }

    public String getStrFrom() {
        return strFrom == null ? "" : strFrom;
    }

    public void setStrFrom(String strFrom) {
        this.strFrom = strFrom;
    }

    public String getStrNote() {
        return strNote == null ? "" : strNote;
    }

    public void setStrNote(String strNote) {
        this.strNote = strNote;
    }

    public static class Address {
        public String adddressName = "";
        public int Code = 0;

        public Address() {
        }

        public String getAdddressName() {
            return adddressName == null ? "" : adddressName;
        }

        public void setAdddressName(String adddressName) {
            this.adddressName = adddressName;
        }

        public int getCode() {
            return Code;
        }

        public void setCode(int code) {
            Code = code;
        }

    }

    public static class Books {
        public String bookName = "";
        public int Code = 0;

        public Books() {
        }

        public String getBookName() {
            return bookName == null ? "" : bookName;
        }

        public void setBookName(String bookName) {
            this.bookName = bookName;
        }

        public int getCode() {
            return Code;
        }

        public void setCode(int code) {
            Code = code;
        }
    }

}